#ifndef _UUIDCOMP_H_
#define _UUIDCOMP_H_

#include <SECore/Ecs/Component.h>
#include <SECore/Util.h>
#include <SECore/Reflect.h>
#include <type_traits>

namespace SEngine
{
    struct UuidComp : public Component<UuidComp> 
    {
        ENABLE_SERIALIZE(Component<UuidComp>)

        UuidComp(Actor & actor) : Component(actor) { uuid = CreateUUID(); }
        virtual ~UuidComp() = default;
        template<typename T>
        T Hash() { return static_cast<T>(std::hash<std::string>()(uuid)); }
        std::string uuid;
    };

    REF_REGISTER_CLASS(UuidComp,
        REF_REGISTER_FIELD(UuidComp, uuid)
    )
} // namespace SEngine


#endif